<template>
  <view>
    <input type="text" v-model="data.nickname" placeholder="请输入昵称">
    <input type="text" v-model="data.tel" placeholder="请输入电话">
    <input type="text" v-model="data.address" placeholder="请输入地址">
    <button @click="handleAdd">添加数据</button>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        data: {
          nickname: '',
          tel: '',
          address: ''
        }
      };
    },
    methods: {
      async handleAdd() {
        const resp = await uniCloud.callFunction({
          name: "addAddress",
          data: this.data
        });
        console.log(resp)
        uni.navigateTo({
          url: '/pages/address/address'
        })
      }
    }
  }
</script>

<style lang="scss">

</style>
